/*******************************************************************************
 * Copyright (c) 2010, 2015 git@git.oschina.net:kaiwill/springstage.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.qinyeit.serviceapp.repository.system;

import com.qinyeit.serviceapp.entity.system.ManagementAccount;
import com.qinyeit.serviceapp.entity.system.ManagementRole;
import com.qinyetech.springstage.core.repository.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/** 
 * ClassName: ManagementRoleRepository <br/>
 * Function: 系统角色 <br/> 
 * date: 2015年10月6日 上午11:50:41 <br/> 
 * 
 * @author wuqing 
 * @version  
 * @since JDK 1.7 
 */
public interface ManagementRoleRepository extends BaseRepository<ManagementRole, Long> {
	public ManagementRole findByCode(String code);
	@Query("select sa from ManagementAccount sa join sa.roles r where r.id= ?1")
	public List<ManagementAccount> findAccountByRoleId(Long id);
}
